<script setup>
import { artGetChannelsService } from '@/api/article'
import { ref } from 'vue'
const channelList = ref([])
const getChannelList = async () => {
  const res = await artGetChannelsService()
  channelList.value = res.data.data
}
getChannelList()
const emit = defineEmits(['update:modelValue'])
defineProps({
  cateId: {
    type: [Number, String],
  },
  width: {
    type: String,
  },
})
</script>
<template>
  <el-select
    style="width: 150px"
    :modelValue="cateId"
    @update:modelValue="emit('update:modelValue', $event)"
    :style="{ width }"
  >
    <!-- 这里的$event代表选中的值，即option上绑定的value -->
    <el-option v-for="item in channelList" :key="item.id" :label="item.cate_name" :value="item.id">
    </el-option>
  </el-select>
</template>
